#include "FlowSimApp.h"

using namespace FlowSim;
using namespace Ogre;

FlowSimApp::FlowSimApp(void)
{
}

FlowSimApp::~FlowSimApp(void)
{

}

void FlowSimApp::createScene(void)
{
  mSceneMgr->setAmbientLight(ColourValue(0.25,0.25,0.25));
  //mSceneMgr->setSkyBox(true,"Examples/MorningSkyBox");

  Light* l = mSceneMgr->createLight("MainLight");
  l->setType(Light::LT_DIRECTIONAL);
  Vector3 dir(0.5,-1,0);
  dir.normalise();
  l->setDirection(dir);
  l->setDiffuseColour(1.0f, 1.0f, 0.8f);
  l->setSpecularColour(1.0f, 1.0f, 1.0f);

  //create the render to texture cameras.
  //_flowSim.init(mSceneMgr);
  _flowSim.init(mSceneMgr,mWindow); //initliaze our simulation.
  
}

void FlowSimApp::createFrameListener()
{
  //ExampleApplication::createFrameListener();
 
  LogManager::getSingleton().logMessage("Creating flow sim frame listener.");
  mFrameListener = new FlowSimFrmListener(mWindow,mCamera,mSceneMgr,&_flowSim);
  mRoot->addFrameListener(mFrameListener);
  mFrameListener->showDebugOverlay(false);
  mSceneMgr->setAmbientLight(ColourValue(0.9,0.9,0.9));
  LogManager::getSingleton().logMessage("Finished creating frame listener.");
  
}
